﻿using System;

class Program
{
    static void Main(string[] args)
    {
        var list = new GenericLinkedList<int>();
        list.AddLast(1);
        list.AddLast(5);
        list.AddLast(3);
        list.AddLast(7);

        Console.WriteLine("打印链表元素：");
        list.ForEach(item => Console.WriteLine(item));

        int sum = 0, min = int.MaxValue, max = int.MinValue;
        list.ForEach(item =>
        {
            sum += item;
            if (item < min) min = item;
            if (item > max) max = item;
        });

        Console.WriteLine($"Sum: {sum}, Min: {min}, Max: {max}");
    }
}